<template>
    <div class="iframe">
        <x-header v-show="!isWeChar">
            <div slot="default" class="common__header--title">{{iframe.iframeName}}</div>
            <div @click="goBack" slot="overwrite-left"><img slot="icon" src="~assets/x3/ico/goback1.png" class="go-back"></div>
        </x-header>
        <div class="home__views">
            <iframe frameborder=0 class="home__views--view" style="position: absolute;" scrolling=auto :src="iframe.iframeUrl"></iframe>
        </div>
    </div>
</template>

<script>
import { mapState } from 'vuex';
import { Loading, TransferDomDirective as TransferDom, XHeader } from 'vux';
import { Mutations, RouteUrl } from 'src/common/const';
export default {
    computed: mapState([
        'popState',
        'isLoading',
        'footerShow',
        'region',
        'iframe',
        "isWeChar"
    ]),
    components: {
        XHeader
    },
    beforeRouteEnter(to, from, next) {
        sessionStorage["IFRAME_FORM_URL"] = from.path;
        next();
    },
    beforeMount() {
        if (sessionStorage["IFRAME_FORM_URL"] == "/") {
            this.$common.goUrl(this, RouteUrl.INDEX);
        }
    },
    methods: {
        goBack() {
            this.$common.goBack(this);
        },
    },
    mounted() {
        document.title = this.iframe.iframeName;


        this.$init.subPageInit(this);
    }
}
</script>

<style lang="scss">
.home__views--view {
  height: 100%;
  width: 100%;
}

.home__views {
  // margin-bottom: 53px;
  width: 100%;
  height: 100%;
  -webkit-overflow-scrolling: touch;
  overflow-y: scroll;
}
</style>
